var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.dispose();
            if (cm.isQuestActive(40606)) {
                cm.warp(327090420, 0, false)
            } else {
                if (cm.isQuestActive(40607)) {
                    cm.warp(327090440, 0, false)
                } else {
                    if (cm.isQuestFinished(40704) && cm.getQuestStatus(40705) == 0) {
                        cm.warp(328090410, 0, false)
                    } else {
                        if (cm.isQuestActive(40800)) {
                            cm.openNpc("镜世界_威尔")
                        } else {
                            cm.playerMessage(5, "漂浮不定的女神之泪……")
                        }
                    }
                }
            }
        }
    }
};